docs: add ADR for institution-defined tag code field#637
Conversation
Proposes a generic Tag.code field in openedx_tagging to hold an institution's own competency identifier, plus a completeness rule that requires it for Competency Taxonomy tags without teaching openedx_tagging what a Competency Taxonomy is. Answers issue openedx#625.
|
Thanks for the pull request, @mgwozdz-unicon! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
… mirror the system-level taxonomy
| short, human-readable identifier an institution can reference in its own systems | ||
| (spreadsheets, internal catalogs, etc). Clicking it drives the workflow that |
There was a problem hiding this comment.
Is it always one identifier, or do institutions sometimes have multiple identifiers for the same tag (e.g. from different systems)?
There was a problem hiding this comment.
It should be only one identifier. Today Competency Frameworks/Taxonomies are sourced through hand crafted spreadsheets rather than any sort of source system probably 99% of the time. I'm pretty sure none of the other LMSs support multiple identifiers for competencies. If there were other identifiers, they would most likely be the CASE GUID or CTDL identifier, which should be explicitly stored as such.
| This identifier is explicitly **not** a CASE or CTDL identifier. Those are external | ||
| standards bodies' IDs that may need their own storage in the future; conflating them | ||
| with an institution's internal code would make each harder to reason about | ||
| independently. This ADR is scoped to the internal, institution-defined code only. |
There was a problem hiding this comment.
I don't know if I agree with that. If we can have a robust system that maps namespaced identifiers to tags, I could imagine us using a system where internal namespaces are peers to standardized ones.
That being said, if and when that time comes, we can always migrate the existing data that we have to some new, more general schema. So I do support the idea that we're focusing strictly on internal codes for now, with the simpler model that implies.
There was a problem hiding this comment.
When support is added for the CASE and CTDL identifiers, I can definitely envision wanting something akin to a tag_identifiers table where the columns of that table are effectively just tag_id, other_id_type, and other_id to support other_id_types of CASE and CTDL. The institution id (code) and/or external_id could potentially be stored in this table too if desired. I wasn't trying to preclude that kind of an idea with this.
There was a problem hiding this comment.
Although, it might make sense to continue keeping the third party identifiers separate from the institution/openedx identifiers. I'm not sure I'd want to migrate those (external_id and code) into this tags_identifiers table since they'd already be functioning fine where they are. Really the only reason to add a new table at all would be out of a fear that the number of additional identifiers might get unweildy, and really even just the 2 additional (CASE and CTDL) may not constitute "unweildy".
| purely as the lookup key to find and update existing tags on re-import. Repurposing | ||
| it as an admin-editable Competency ID would conflict with that existing, load-bearing | ||
| contract. |
There was a problem hiding this comment.
Can you expand on why this is currently immutable, and why it must remain so? My understanding was that external_id was created for a similar use case to what's being proposed here.
There was a problem hiding this comment.
Trying to jog my memory on this... I think it was because we needed an identifier that wasn't internal to Open edX (since sharing identifiers internal to the platform was deemed a security concern) that could be stable on import/export. Because otherwise, if you edit the external_id and re-import, then the platform has no way of knowing what you were editing. Whereas institutions need a mutable identifier that they can keep as human readable and in alignment with the current tag name that may be edited as well.
There was a problem hiding this comment.
So is it accurate to say that if we either exported the UUID, or provided a "previous_id" column in the import CSV format so that we could remap external_id entries, we wouldn't need this new code field?
|
@ormsbee Great questions - I'm happy to update my draft for clarity around them, but I want to make sure any follow-up you may have is resolved first, so just let me know if you have follow-up questions/thoughts or if you're ready for me to update it. |
|
I'm struggling to understand the need for
Could you link to the UX designs and/or provide a concrete example of what a given Tag might have for its value, code, and external_id? |
Yes, here is a screenshot from the UX designs: So in this example, "CCRS-1.3" would be the code value for the tag that has the value "Inference". Here CCRS stands for "Career and College Readiness Skills" which is the name of the Taxonomy. If the institution changed their code (institution competency id) to "CCRS-1.4" and re-uploaded and it had instead been the external_id value, then the platform would have no way of knowing what tag is supposed to get updated to "CCRS-1.4". So in this example, when the institution first does their upload, code and external_id may have the same value, but code can change while external_id must always be the same. The id would be internal to the instance and uuid can't be used for this purpose because it's not human readable. |
|
Thanks, this helps a lot.
Is changing the institutional competency id a known use case? They appear to me, visually, like the sort of code that an institution would define once and then make a point to keep stable. |
My main line of questioning is just to see if we can somehow amend the import format so that we can still use the |
|
@mgwozdz-unicon @ormsbee: |
I think this is a path forward if there ends up being further competency-specific tag metadata. But at the moment, I think we're both reluctant about proliferation of identifiers (whether CBE-specific or not) without clarity that the existing identifiers don't suffice. |
|
This use case is exactly what the Making it mutable is fine.
This is a problem whether you use |
|
@bradenmacdonald I just updated the old PR for |
Do we need to include it on exports? I would think that I don't think our taxonomy exports need to include history or "previous IDs"; they don't even include any taxonomy metadata at the moment. In any case, there is an official taxonomy published somewhere else, which likely includes a proper changelog (example), so we don't need to make a poor-man's version of that. Just let people use the official upstream dataset if they need the full picture and history etc. |
That sounds right to me, I should have referred to the import and not the export. And the solution you put here does seem much simpler than I thought. |
|
I agree that we don't need to persist the We might want to eventually persist a changelog, since we already break it down into ImportAction primitives anyway (e.g. one row per import, with a JSON representation of the actions that were taken). |
|
Misc. consideration for testing (does not need to be part of any ADR): One edge case would be an |
PR review and follow-up team discussion converged on making Tag.external_id mutable via a new previous_id import column, rather than adding a separate Tag.code field, to give institutions an editable competency identifier.
The decision no longer adds a Tag.code field, so the filename should reflect the mutable external_id approach instead.
|
I've revised the ADR based on this discussion plus a follow-up team conversation. Summary: dropped the new To the open questions: @ormsbee — yes, exactly what you proposed. A @kdmccormick — renaming the identifier is a confirmed use case, not hypothetical: institutions do this when they revise a competency taxonomy (e.g. after a curriculum or accreditation-standard update). They renumber the existing tags in place rather than standing up a new taxonomy for the same competencies, so we need the rename to survive without losing each tag's associations (like its @jesperhodge — on why it needs to be mutable at all: the alternative is treating every identifier change as delete-and-recreate, which is exactly what loses those associations and the tag's identity across import/export. That's the "keep external_id strictly immutable" alternative in the revised ADR, and it's rejected for that reason. Also, to your and Braden's resolved point: @jesperhodge on |

Claude assisted...
Summary
Tag.code, a generic, optional field onopenedx_tagging'sTagmodel, to hold an institution's own competency identifier — distinct from CASE/CTDL and from the existingexternal_idfield.codefor every tag in a Competency Taxonomy, enforced through a generic property onTaxonomythat only a Competency Taxonomy subclass turns on, soopenedx_taggingnever has to know what a Competency Taxonomy is.openedx/openedx-core#625("Determine what and how many ID fields should be added to the Taxonomy data model").Why
Competency Management UX designs show a "Competency ID" that institutions click to build competency-criteria associations. Institutions need their own internal identifier for this, separate from any future CASE/CTDL identifiers. The existing
external_idfield can't be reused: it's de facto immutable and is the load-bearing lookup key for import/export matching, so giving it a second, editable meaning would break that contract.Status
Proposed. This is a recommendation for engineering and Open edX community review, not an implementation — no code changes are included in this PR.
Dependencies and follow-ups (tracked separately, not in this PR)
#613(implements theCompetencyTaxonomymodel) needs to override thetag_code_requiredproperty this ADR defines. This ADR's property should land before or alongside [BE] Implement CBE core data models (CompetencyTaxonomy, criteria, learner status) #613, not after it — [BE] Implement CBE core data models (CompetencyTaxonomy, criteria, learner status) #613 depends on this ADR, not the reverse.#634("Taxonomy subclasses: embrace or deprecate?") is an open architecture discussion that could affect the subclass-override mechanism this ADR relies on.These are called out in a comment on #625 rather than in the ADR itself.